local unitName = "lzmex"

local unitDef =
{
-- Internal settings
	Category = "LAND",
	ObjectName = "lzmex.s3o",
	script = "lzmex.lua",
	buildPic = "lzmex.png",
	hideDamage = false,
	showPlayerName = false,
	capturable = true,
-- Unit limitations and properties
	Description = "Metal extractor with a clone sitting on it wielding a pistol.",
	MaxDamage = 100,
	Name = "Metal Extractor",
	RadarDistance = 0,
	SightDistance = 200,
	Upright = 1,
	levelground = 1,
	idleAutoHeal = 0,
-- cost
	buildCostMetal = 200,
	buildCostEnergy = 100,
	buildTime = 25,
-- economy
	EnergyStorage = 0,
	EnergyUse = 10,
	MetalStorage = 10,
	EnergyMake = 0,
	MakesMetal = 0,
	MetalMake = 0,
	activateWhenBuilt = true,
	extractsMetal = 0.001,
	onoffable = true,
	smoothAnim = true,
-- Movement and related
	Acceleration = 3.0,
	MaxVelocity = 3.0,
	BrakeRate = 3.0,
	FootprintX = 2,
	FootprintZ = 2,
	MovementClass = "Default2x2",
	TurnRate = 900,
	MaxSlope = 10,
	turnInPlace = true,
-- Cando
	canMove = true,
	canRepeat = true,
	canSelfDestruct = true,
	canAttack = true,
-- Other stuff

-- Building
	Builder = false,
	Reclaimable = true,

	weapons = {
		[1] = {
			--badTargetCategory = [[VTOL]],
			def = [[EMG]],
		},
	},
}

local weaponDefs = {
	EMG = {
		areaOfEffect = 8,
		avoidFeature = false,
		burst = 3,
		burstrate = 0.1,
		craterBoost = 0,
		craterMult = 0,
		endsmoke = 0,
		explosionGenerator = [[custom:EMG_HIT]],
		fireStarter = 100,
		impulseBoost = 0.123,
		impulseFactor = 0.123,
		intensity = 0.7,
		lineOfSight = true,
		name = [[peewee]],
		noSelfDamage = true,
		range = 380, --Normal 180
		reloadtime = 0.31,
		renderType = 4,
		rgbColor = [[1 0.95 0.4]],
		size = 1.75,
		soundStart = [[flashemg]],
		sprayAngle = 1180,
		startsmoke = 0,
		tolerance = 5000,
		turret = true,
		weaponTimer = 0.1,
		weaponType = [[Cannon]],
		weaponVelocity = 500,
		damage = {
			default            = 11,
			gunships           = 3,
			hgunships          = 3,
			l1bombers          = 3,
			l1fighters         = 3,
			l1subs             = 1,
			l2bombers          = 3,
			l2fighters         = 3,
			l2subs             = 1,
			l3subs             = 1,
			vradar             = 3,
			vtol               = 3,
			vtrans             = 3,
		},
	},
}
unitDef.weaponDefs = weaponDefs

return lowerkeys({ [unitName] = unitDef })
